// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IJsonWrapper.cs" company="Leonardo Boshell">
//   Copyright (c) 2007 Leonardo Boshell. All rights reserved.
// </copyright>
// <author name="Leonardo Boshell" email="leonardoboshell@users.sourceforge.net"/>
// <license>
//   All the source code and related files distributed with this software have
//   been dedicated to the public domain by the authors.
//   
//   Anyone is free to copy, modify, publish, use, compile, sell, or distribute
//   the software, either in source code form or as a compiled binary, for any
//   purpose, commercial or non-commercial, and by any means.
//   
//   Thank you for reading this notice. Inspired by the enlightened words used by
//   the authors of another software project, a very popular one, also in the
//   public domain, here's a blessing:
//   
//     May you find forgiveness for yourself and forgive others.
//     May you experience and share the gift of uncoditional love.
//     May you see light, wherever the illusion of darkness appears.
// </license>
// --------------------------------------------------------------------------------------------------------------------

namespace LeonardoBoshell.LitJson
{
    using System.Collections;
    using System.Collections.Specialized;

    /// <summary>
    /// Interface that represents a type capable of handling all kinds of JSON
    /// data. This is mainly used when mapping objects through JsonMapper, and
    /// it's implemented by JsonData.
    /// </summary>
    public interface IJsonWrapper : IList, IOrderedDictionary
    {
        /// <summary>
        /// Gets a value indicating whether IsArray.
        /// </summary>
        bool IsArray { get; }

        /// <summary>
        /// Gets a value indicating whether IsBoolean.
        /// </summary>
        bool IsBoolean { get; }

        /// <summary>
        /// Gets a value indicating whether IsDouble.
        /// </summary>
        bool IsDouble { get; }

        /// <summary>
        /// Gets a value indicating whether IsInt.
        /// </summary>
        bool IsInt { get; }

        /// <summary>
        /// Gets a value indicating whether IsLong.
        /// </summary>
        bool IsLong { get; }

        /// <summary>
        /// Gets a value indicating whether IsObject.
        /// </summary>
        bool IsObject { get; }

        /// <summary>
        /// Gets a value indicating whether IsString.
        /// </summary>
        bool IsString { get; }

        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        bool GetBoolean();

        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        double GetDouble();

        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        int GetInt();

        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        JsonType GetJsonType();

        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        long GetLong();

        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        string GetString();

        /// <summary>
        /// </summary>
        /// <param name="val">
        /// The val.
        /// </param>
        void SetBoolean(bool val);

        /// <summary>
        /// </summary>
        /// <param name="val">
        /// The val.
        /// </param>
        void SetDouble(double val);

        /// <summary>
        /// </summary>
        /// <param name="val">
        /// The val.
        /// </param>
        void SetInt(int val);

        /// <summary>
        /// </summary>
        /// <param name="type">
        /// The type.
        /// </param>
        void SetJsonType(JsonType type);

        /// <summary>
        /// </summary>
        /// <param name="val">
        /// The val.
        /// </param>
        void SetLong(long val);

        /// <summary>
        /// </summary>
        /// <param name="val">
        /// The val.
        /// </param>
        void SetString(string val);

        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        string ToJson();

        /// <summary>
        /// </summary>
        /// <param name="writer">
        /// The writer.
        /// </param>
        void ToJson(JsonWriter writer);
    }
}
